import akshare as ak

# 获取 A 股历史数据
stock_zh_a_hist_df = ak.stock_zh_a_hist(
    symbol="000001",  # 股票代码（平安银行）
    period="daily",   # 日线数据
    start_date="20220101",  # 开始日期
    end_date="20221231",    # 结束日期
    adjust="qfq"            # 前复权
)

# 保存为 CSV 文件
stock_zh_a_hist_df.to_csv("000001.csv", index=False)
print(stock_zh_a_hist_df)



"""
pip install akshare
https://github.com/mpquant/Ashare

https://github.com/akfamily/akshare
"""